#!/usr/bin/env

import pygame


if __name__ == "__main__":
    pygame.init()
    clock = pygame.time.Clock()
    win = pygame.display.set_mode((SCREEN_W, SCREEN_H))
    reset()
    running = True
    while running:
        clock.tick(15)
        for e in pygame.event.get():
            if e.type == pygame.QUIT:
                running = False

            if e.type == pygame.KEYDOWN:
                if e.key == pygame.K_ESCAPE:
                    running = False
                else:
                    reset() if is_gameover else turn(e.key)

        win.fill(BG_COLOR, (0, 0, SCREEN_W, SCREEN_H))
        move()
        draw(win)
        pygame.display.flip()

    pygame.quit()
